package cn.lili.controller.feign;

import cn.lili.modules.order.order.entity.dos.OrderItem;
import cn.lili.modules.promotion.client.ReturnActivityClient;
import cn.lili.modules.promotion.entity.dos.ReturnActivityUser;
import cn.lili.modules.promotion.service.ReturnActivityUserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequiredArgsConstructor
public class ReturnActivityFeignController implements ReturnActivityClient {

    @Resource
    private ReturnActivityUserService returnActivityUserService;


    @Override
    public Boolean generate(String userId, OrderItem orderItem) {
        return returnActivityUserService.generate(userId,orderItem);
    }

    @Override
    public Boolean updateStatus(String userId,String orderSn, String orderItemSn) {
        return returnActivityUserService.updateStatus(userId,orderSn, orderItemSn);
    }

    @Override
    public Boolean updateUseStatus(String id, String useStatus) {
        return returnActivityUserService.updateUseStatus(id,useStatus);
    }

    @Override
    public Boolean updateBecomeDue() {
        return returnActivityUserService.updateBecomeDue();
    }

    @Override
    public List<ReturnActivityUser> getList(String userId) {
        return returnActivityUserService.getList(userId, null);
    }

    @Override
    public ReturnActivityUser getById(String id) {
        return returnActivityUserService.getById(id);
    }

    @Override
    public Boolean deleteUserReturnActivity(String userId, String orderItemSn) {
        return returnActivityUserService.deleteUserReturnActivity(userId, orderItemSn);
    }

    @Override
    public Boolean deleteUserReturnActivityByOrderSn(String userId, String orderSn) {
        return returnActivityUserService.deleteUserReturnActivityByOrderSn(userId, orderSn);
    }
}
